package pattern.behavioral.strategy.withabstract;

import java.math.BigDecimal;

/**
 * @author: chaoyang.ren  
 * @date:Jun 1, 2017  
 * @time:4:38:37 PM   
 * @email:chaoyang.ren@foxmail.com  
 * @version: 1.0
 */
public class Test {

	public static void main(String[] args) {
		Price price = new Price(BigDecimal.valueOf(100d));
		PriceStrategy priceStrategy = new GoldMemberPriceStrategy();
		price.setPriceStrategy(priceStrategy);
		price.calculatePrice();
		
		PriceStrategy priceStrategy2 = new SilverMemberPriceStrategy();
		price.setPriceStrategy(priceStrategy2);
		price.calculatePrice();
		
		PriceStrategy priceStrategy3 = new NormalMemberPriceStrategy();
		price.setPriceStrategy(priceStrategy3);
		price.calculatePrice();
	}

}

